home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
TECHNICA
/
COMPUTER
/
H254.ZIP
/
IRITSM3S.ZIP
/
IRIT
/
CONE2CYL.IRT
< prev
next >
Wrap
Text File
|
1991-09-04
|
771b
|
37 lines
#
# Intersection of cone and a cylinders (more complex this time):
#
# Created by Gershon Elber, Sep. 89
#
save_mat = view_mat;
view_mat = view_mat * scale(vector(0.2, 0.2, 0.2));
save_res = resolution;
resolution = 32;
cone1 = cone(vector(0, 0, -1),vector(0, 0, 4), 2);
cylin1= cylin(vector(0, 3, 0.3),vector(0, -6, 0), 1);
cube1 = box(vector(-2, -2, -2), 4, 4, 3.6);
s1 = (cone1-cylin1)*cube1;
beep(500,300);
view(list(s1), true);
free(cylin1);
free(cone1);
free(cube1);
resolution = 16;
cylin2= cylin(vector(0, 0, -2),vector(0, 0, 6), 0.5);
s2 = s1 - cylin2;
beep(500,300);
interact(list(s2), false);
free(cylin2);
free(s1);
s2 = convex(s2);
save("cone2cyl", list(view_mat,s2));
resolution = save_res;
view_mat = save_mat;